<template>
  <div class="pagination-main" :style="{textAlign:align}">
    <el-pagination
      :current-page="page.start"
      :page-sizes="page.sizes"
      :page-size="page.limit"
      layout="total, sizes, prev, pager, next, jumper"
      :total="page.total"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>

<script>
export default {
  name: 'Pagination',
  props: {
    page: Object,
    align: {
      type: String,
      default: 'right'
    }
  },
  data() {
    return {

    }
  },
  methods: {
    handleSizeChange(v) {
      this.page.size = v
      this.$emit('page-change')
    },
    handleCurrentChange(v) {
      this.page.start = v
      this.$emit('page-change')
    }
  }
}
</script>
<style lang="scss" scoped>

</style>

